Empresas
Empleos
  • Sobre nosotros
  • Soluciones
    • Publicación de vacantes
      Publica tu vacante y recibe candidatos calificados en 48h.
    • Evaluación de candidatos
      500+ pruebas técnicas y psicológicas, más anti-fraude.
    • Headhunting
      Búsqueda ejecutiva a la medida de principio a fin.
    • Nómina + EOR
      Dispersión de nómina y EOR en más de 15 países de LATAM.
  • Precios
  • Empleos

0

145
Vistas
Using the spread operator on Iterable gives `Array [ Array Iterator ]`

We recently moved our react project over to nx, and in the process, something weird is now happening with spread operators. I am doing the following

[...Array(someNumber).keys()]

which should give [0,1,2,...,someNumber-1] however when I log the result I get Array [ Array Iterator ]

I have had the same problems when I try and do [...someMap.entries()].

I suspected it might be a problem with Babel, but have tried using both @babel/plugin-transform-spread and @babel/plugin-proposal-object-rest-spread with no luck. We are using the following presets in our react app

"presets": [
    [
      "@nrwl/react/babel",
      {
        "runtime": "automatic"
      }
    ]
  ]

Also, I don't know if this is related, but now we also get an error when using someString.replace saying Uncaught TypeError: someString.replace is not a function

Does anyone know what is causing this problem?

about 4 years ago · Juan Pablo Isaza
Responde la pregunta
Encuentra empleos remotos

¡Descubre la nueva forma de encontrar empleo!

Top de empleos
Top categorías de empleo
Empresas
Publicar vacante Precios Comercial
Legal
Términos y condiciones Política de privacidad
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomiéndame algunas ofertas
Necesito ayuda